<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="test1.User" %>
<%@ page import="test1.UserDAO" %>
<%
    request.setCharacterEncoding("UTF-8");
    String userName = request.getParameter("userName");
    String nickname = request.getParameter("nickname");
    String password = request.getParameter("password");
    String telephone = request.getParameter("telephone");
    String photo = request.getParameter("photo");
    String isAuthor = request.getParameter("isAuthor");
    String brief = request.getParameter("brief");

    User user = new User();
    user.setUserName(userName);
    user.setNickname(nickname);
    user.setPassword(password);
    user.setTelephone(telephone);
    user.setPhoto(photo);
    user.setIsAuthor(isAuthor);
    user.setBrief(brief);

    UserDAO userDAO = new UserDAO();
    userDAO.addUser(user);
    response.sendRedirect("index.jsp");
%>